Heat 2 cups of water to boiling by microwaving in a large glass bowl for 4-5 minutes. Stir in contents of the Jell-O package until it dissolves. Separate the pineapple juice from the crushed pineapple by draining the juice into a small saucepan and setting aside for later.
Add marshmallows to the hot lemon Jell-O and stir until dissolved, then stir in the crushed pineapple. Stir in 2 additional cups of cold water, and pour into a large rectangular glass dish. Transfer the Jell-O to the fridge and allow to set completely, about 3-4 hours.
While the Jell-O is setting up in the fridge, prepare the pineapple whipped cream topping by whisking the beaten egg, flour, and ¼ cup sugar with the reserved pineapple juice in a small saucepan and heating over medium-low heat, whisking constantly, until the sauce begins to thicken, about 4 to 6 minutes. Remove from heat and cool completely.
In another bowl, beat the heavy cream with an electric mixer on high speed, gradually adding the additional 2-3 tablespoons of sugar and vanilla, until whipped cream forms and holds its shape when beaters are removed.
Fold the cooled pineapple juice mixture into the whipped cream until combined, then spread over the completely set Jell-O. Sprinkle with the chopped walnuts and refrigerate until ready to serve.